using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;

namespace ERPBackend.Models
{
    public class ProductionStockIn : BaseModel
    {
        [Required]
        [MaxLength(50)]
        public string StockInCode { get; set; }

        [Required]
        public int ProductionOrderId { get; set; }

        // [ForeignKey("ProductionOrderId")]
        // public virtual ProductionOrder ProductionOrder { get; set; }

        [Required]
        public int WorkshopId { get; set; }

        [ForeignKey("WorkshopId")]
        public virtual Workshop Workshop { get; set; }

        [Required]
        public int WarehouseId { get; set; }

        [ForeignKey("WarehouseId")]
        public virtual Warehouse Warehouse { get; set; }

        [Required]
        public DateTime StockInDate { get; set; }

        [Column(TypeName = "decimal(18,4)")]
        public decimal TotalQuantity { get; set; }

        [Required]
        [MaxLength(50)]
        public string Status { get; set; }

        public int? ApprovedBy { get; set; }

        public DateTime? ApprovedTime { get; set; }

        public string Remark { get; set; }

        public virtual ICollection<ProductionStockInItem> ProductionStockInItems { get; set; } = new List<ProductionStockInItem>();
    }
}